package info.ask4research.model.toolsAndMaterials;

import info.ask4research.model.UnitOfLearning;
import info.ask4research.model.enums.ServiceType;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;


@Entity
@Table(name = "TOOLSANDMATERIALS")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "DISCRIMINATOR", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("TYPE")
public class ToolAndMaterial implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5142815740599235170L;

	@Id
	@GeneratedValue
	@Column(name="tam_ID")
	private int id;
	@Column(name="title", nullable=false)
	@JsonProperty
	private String title;
	@ManyToOne(cascade = CascadeType.ALL)
	@JsonIgnore
	private UnitOfLearning unitOfLearning;
	@Column(name="description", nullable=true)
	@Lob
	@JsonProperty
	private String description;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public UnitOfLearning getUnitOfLearning() {
		return unitOfLearning;
	}
	public void setUnitOfLearning(UnitOfLearning unitOfLearning) {
		this.unitOfLearning = unitOfLearning;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	

	
}
